import request from "../utils/request";

let api_name = "/gameInfo";
export default {
  // 获取游戏分类数据
  getGameList() {
    return request({
      url: `${api_name}`,
      method: "get",
    });
  },
  // 根据Id获取信息
  getList(id) {
    return request({
      url: `${api_name}/${id}`,
      method: "get",
    });
  },
  // 根据id获取游戏详情数据
  getGameById(gameId) {
    return request({
      url: `${api_name}/${gameId}`,
      method: "get",
    });
  },
  //
  addGameCart(gameObj) {
    return request({
      url: `/addGame`,
      method: "post",
      data: gameObj,
    });
  },
};
